from django.db import models


class Email(models.Model):
    class Meta:
        ordering = ['-pk']
        verbose_name_plural = verbose_name = 'Email'

    biao_ti = models.TextField(verbose_name="标题", blank=True, null=True)
    fa_jian_ren = models.TextField(verbose_name="发件人", blank=True, null=True)
    nei_rong = models.TextField(verbose_name="内容", blank=True, null=True)
    fu_jian_id = models.TextField(verbose_name="附件ID", blank=True, null=True)
    fu_jian_shu_liang = models.TextField(verbose_name="附件数量", blank=True, null=True)
    chuang_jian_shi_jian = models.DateTimeField(verbose_name="创建时间", blank=True, null=True, auto_now_add=True)
    fa_song_shi_jian = models.DateTimeField(verbose_name="发送时间", blank=True, null=True)
    guo_qi_shi_jian = models.DateTimeField(verbose_name="过期时间", blank=True, null=True)

    def __str__(self):
        return f'{self.biao_ti} --- {self.fa_jian_ren} --- {self.guo_qi_shi_jian}'
